#-*- coding: utf8 -*-
from django.db import models

class Director(models.Model):

    dni = models.CharField(max_length=10)
    firstname = models.CharField('Nombres',max_length=30)
    lastname = models.CharField('Apellidos',max_length=30)
    title = models.CharField('Titulo',max_length=15)
    email = models.CharField('Correo',max_length=30)
    phone = models.CharField('Teléfono',max_length=10)

    def get_absolute_url(self):
        #temp
        return 'http://localhost:8000/admin/tcis/director/%d' % self.id

    def __unicode__(self):
        return '%s %s' % (self.firstname,self.lastname)


statuses = ((1,'Aprobado'),(2,'Desarrollo'),(3,'Terminada'))


class Thesis(models.Model):

    title = models.TextField('Titulo')
    approbation = models.DateField('Aprobacion') #auto_now_add=True
    graduation = models.DateField('Finalizacion')
    status = models.CharField('Estado',max_length=15, choices=statuses)
    director = models.ForeignKey(Director)
    thesisstudent = models.TextField('Tesista',max_length=60)
    
    def __unicode__(self):
        return self.title
